<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<!--
Design by Free CSS Templates
http://www.freecsstemplates.org
Released for free under a Creative Commons Attribution 2.5 License

Name       : Everyday Series
Description: A three-column, fixed-width blog design.
Version    : 1.0
Released   : 20090617

-->
<html xmlns="http://www.w3.org/1999/xhtml">
<?php 
	session_start();
	require_once('functions.php');
	require_once('LeaveManager.php');
?>
	<head>
			<link href="template.css" rel="stylesheet" type="text/css" media="screen" />
			<title>Leave App Menu</title>
			<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.js" type="text/javascript"></script>
			<script src='jquery.js'></script>
			<script>
			
			var timeout = 500;
			var closetimer = 0;
			var ddmenuitem = 0;

			function jsddm_open()
			{  jsddm_canceltimer();
			   jsddm_close();
			   ddmenuitem = $(this).find('ul').css('visibility', 'visible');}

			function jsddm_close()
			{  if(ddmenuitem) ddmenuitem.css('visibility', 'hidden');}

			function jsddm_timer()
			{  closetimer = window.setTimeout(jsddm_close, timeout);}

			function jsddm_canceltimer()
			{  if(closetimer)
			   {  window.clearTimeout(closetimer);
				  closetimer = null;}}

			$(document).ready(function()
			{  $('#jsddm > li').bind('mouseover', jsddm_open)
			   $('#jsddm > li').bind('mouseout',  jsddm_timer)});

			document.onclick = jsddm_close;
		 
			$(document).ready(function(){
			   
			   $("#add").css({
				'text-decoration':'none',
				'font-size':'20px'
			   });
			   $("#add").hover(function () {
					$(this).css({'text-decoration':'none','color':'#FFFFFF', 'text-color':'#FFFFFF', 'background-color':'#FF9966','font-weight':'bold'});
				  }, function () {
					var cssObj = {
					  'text-decoration':'none',
					  'background-color':'white',
					  'font-weight':'',
					  'color':''
					}
					$(this).css(cssObj);
				  });
				  
				$("#view").css({
				'text-decoration':'none',
				'font-size':'20px'
			   });
			   $("#view").hover(function () {
					$(this).css({'text-decoration':'none','color':'white','background-color':'#FF9966','font-weight':'bold'});
				  }, function () {
					var cssObj = {
					  'text-decoration':'none',
					  'background-color':'white',
					  'font-weight':'',
					}
					$(this).css(cssObj);
				  });		
				 
				$("#edit").css({
				'text-decoration':'none',
				'font-size':'20px'
			   });
			   $("#edit").hover(function () {
					$(this).css({'text-decoration':'none','color':'white','background-color':'#FF9966','font-weight':'bold'});
				  }, function () {
					var cssObj = {
					  'text-decoration':'none',
					  'background-color':'white',
					  'font-weight':'',
					}
					$(this).css(cssObj);
				  });  
			   
			   $("#welcome").css({
				'font-size':'30px',
				'border':'5px solid white'
			   });
			
				$("#logout").css({
					'background-color':'white',
					'color':'#2F2825'
				});
				$("#logout").hover(function () {
					$(this).css({'background-color' : '#993333','color':'white','font-weight':'bold'});
				  }, function () {
					var cssObj = {
					  'background-color' : 'white',
					  'color' : '#2F2825',
					  'font-weight':''
					}
					$(this).css(cssObj);
				  });
				 			   
			 });
			
			</script>
		</head>
<body>
<!-- start header -->
<div id="header">
	<div id="logo">		
		<h1><span>UPLB</span> &nbsp; Leave Application</h1><br/>		
		<ul id="jsddm">
			<?php if(isset($_SESSION['login']) && $_SESSION['login']==true) {?>
			<li><a href="#">ACTIONS <span>&#x25BC</span></a>
				<ul>
					<li><a href="AddEmployee.php">Add Employee</a></li>
					<li><a href="searchEmployee.php">Change Employee</a></li>
				</ul>
			</li>
			<li><a href="logout.php">LOG OUT</a>
			</li>
			<?php } ?>
		</ul>
	</div>
</div>
<!-- end header -->
<div id="wrapper">
	<!-- start page -->
	<div id="page">
	<div id="page-bg">
		<div id="sidebar1" class="sidebar">			
		</div>
		<!-- start content -->
		<div id="content">
			<div class="post">
				<div class="entry">
<?php		
	if (isset($_SESSION['username'])) {
		$username = $_SESSION['username'];
?>
					<div class='greeting' align="center"><p>Welcome, <?php echo $username; ?>!</p></div><br />			
					<table width="250" align='center'>
						<tr id="add"><td><center><a href="startAdd.php" >Add Leave Form</center></a></td></tr>
						<?php
						$return = LeaveManager :: getLeaveData($_SESSION['employeeNumber'], "load");
						
						if(mysql_num_rows($return)>0){
							echo "<tr id='edit'><td><center><a href='startEdit.php'>Edit Leave Form</center></a></td></tr>";
							echo "<tr id='view'><td><center><a href='startView.php' target='#'>View Leave Report</center></a></td></tr>";
						 } ?>
					</table>					

<?php } else {
?>
		You're not supposed to be here!<br/><br/>
		Would you like to <a href='index.php'>Log In</a> or <a href='register.php'>Register</a> ? <br/>
<?php	
	}
?>	
				</div>
			</div>
		</div>
		<!-- end content -->
		<!-- start sidebars -->
		<div id="sidebar2" class="sidebar">
		</div>
		<!-- end sidebars -->
		<div style="clear: both;">&nbsp;</div>
	</div>
	</div>
	<!-- end page -->
</div>
<div id="footer">
</div>
</body>
</html>
